<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/back.css" />
<script type="text/javascript">
function hide(picName,tbodyId){
	if(document.getElementById(tbodyId).style.display=="none"){
		document.getElementById(tbodyId).style.display="block";
		document.getElementById(picName).src="${pageContext.request.contextPath}/images/root_O.gif";
	}else{
		document.getElementById(tbodyId).style.display="none";
		document.getElementById(picName).src="${pageContext.request.contextPath}/images/root_C.gif";
	}
}
</script>

<table align="center" width="600px" border="1" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#0066cc" style="font-size: 12">
		<tr bgcolor="#AEC8E4" height="40px" align="center">
			<th>商品类别</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${biglist}" var="class">
			<tr height="30px">
				<td style="padding-left: 100px;">
					<img src="${pageContext.request.contextPath}/images/root_O.gif" id="pic${class.classId}" onClick="hide(this.id,${class.classId});" />
					<font style="color:#FF0000">${class.className}</font>
				</td>
				<td align="center">
					<a href="${pageContext.request.contextPath}/ClassServlet?service=modifyClass&classId=${class.classId}">修改</a>
					<a href="${pageContext.request.contextPath}/ClassServlet?service=deleteClass&classId=${class.classId}">删除</a>
				</td>
			</tr>
			<tbody id="${class.classId}">
				<c:forEach items="${list}" var="item">
					<c:if test="${item.parentId==class.classId}">
						<tr id="${class.classId}" align="center" height="25px;">
							<td bgcolor="#FFF892">${item.itemName}</td>
							<td>
								<a href="${pageContext.request.contextPath}/ClassServlet?service=modifyItem&itemId=${item.itemId}">修改</a>
								<a href="${pageContext.request.contextPath}/ClassServlet?service=deleteItem&itemId=${item.itemId}">删除</a>
							</td>
						</tr>
					</c:if>
				</c:forEach>
			</tbody>
		</c:forEach>
</table>